package com.walmart.entity;

import java.math.BigDecimal;

public class Product {
    /**
     *  商品名
     */
    private String name;
    /**
     *  商品折扣
     */
    private BigDecimal sale;
    /**
     *  商品单价
     */
    private BigDecimal price;

    public String getName() {
        return name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getSale() {
        return sale;
    }

    public void setSale(BigDecimal sale) {
        this.sale = sale;
    }
    public Product(String name, int price){
        this.name = name;
        this.price = BigDecimal.valueOf(price);
        this.sale = BigDecimal.valueOf(1);
    }
    public Product(String name, int price, double sale){
        this.name = name;
        this.price = BigDecimal.valueOf(price);
        this.sale = BigDecimal.valueOf(sale);
    }
    public Product(String name, BigDecimal price){
        this.name = name;
        this.price = price;
        this.sale = BigDecimal.valueOf(1);
    }
     public Product(String name, BigDecimal price, BigDecimal sale){
        this.name = name;
        this.price = price;
        this.sale = sale;
    }

}
